#include "keyboardkey.h"

KeyboardKey::KeyboardKey(QString _normal_text, QString _shift_text, QWidget *parent) :
    QToolButton(parent)
{
    this->normal_text = _normal_text;
    if ( _shift_text.isEmpty() )
        _shift_text = _normal_text;
    this->shift_text = _shift_text;
    this->setText(this->normal_text);

    this->setMinimumSize(QSize(40,40));
    this->setMaximumSize(QSize(40,40));

    connect(this, SIGNAL(clicked()), this, SLOT(clicked_key()));
    //connect(this, SIGNAL(clicked(bool)), this, SLOT(clicked_key()));
}
///////////////////////////////////////////////////////////////////////////////////
void KeyboardKey::setShift()
{
    this->setText(this->shift_text);
}
///////////////////////////////////////////////////////////////////////////////////
void KeyboardKey::setNormal()
{
    this->setText(this->normal_text);
}
///////////////////////////////////////////////////////////////////////////////////
void KeyboardKey::clicked_key()
{
    emit(clicked(this->text()));
}
